package com.wushi.lenovo.asia5b.app_di.profile.presenter;

import com.mvp.base.BasePresenter;
import com.wushi.lenovo.asia5b.app_di.profile.mvpview.ResetPassActivityView;
import com.wushi.lenovo.asia5b.app_http.ApiService;

import java.util.Map;

import javax.inject.Inject;

/**
 * Created by zhangyuncai on 2018/12/3.
 */
public class ResetPassActivityPresenter extends BasePresenter<ResetPassActivityView> {

    ApiService apiService;

    @Inject
    public ResetPassActivityPresenter(ApiService apiService) {
        this.apiService = apiService;
    }

    /**
     * @param map
     * @param type 1/2  邮箱验证/短信验证
     */
    public void resetLoginPass(Map<String, Object> map, int type) {
        if (type == 1) {
            baseSubscribe(apiService.resetLoginPassWord2(map), resultModel -> {
                getView().resetLoginPass(resultModel);
            });
        } else {
            baseSubscribe(apiService.resetLoginPassWord(map), resultModel -> {
                getView().resetLoginPass(resultModel);
            });
        }

    }
}